package cn.wit.test;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.stage.Stage;

public class DemoJavaFxGeneric extends Application{

	@Override
	public void start(Stage primaryStage) throws Exception {

//		Label label = new Label();
		GenericLabel<Integer> label = new GenericLabel<>(18);
		
//		label.getMesage();
		
		Scene scene = new Scene(label,400,400);
		
		primaryStage.setScene(scene);
		
		primaryStage.show();
	}
	
	public static void main(String[] args) {
		launch(args);
	}



}
class GenericLabel<T> extends Label{
	private T mesage;
	
	public T getMesage() {
		return mesage;
	}

	public void setMesage(T mesage) {
		this.mesage = mesage;
	}

	public GenericLabel(T i) {
		this.mesage = i;
		
		setText(String.valueOf(mesage));
	}
}
